package com.zpz.framework.zpzoauth.service;


import com.github.pagehelper.PageInfo;
import com.zpz.framework.zpzoauth.common.result.ZpzOauthResultMsg;
import com.zpz.framework.zpzoauth.pojo.qo.*;
import com.zpz.framework.zpzoauth.pojo.vo.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author zhangpanzhi
 * @time 2019-07-09
 * @description 未经本人允许请勿随便改动，尊重劳动
 * */
public interface ZpzOauthFrameUserService {
    ZpzOauthResultMsg<PageInfo<GetUserDepartmentVo>>  getUserDepartment(GetUserDepartmentQo getUserDepartmentQo);
    /**
     * 用户手机号注册
     * */
    ZpzOauthResultMsg<Boolean> register(RegisterQo registerQo, String clientId);
    /**
     * 用户名注册
     * */
    ZpzOauthResultMsg<String> registerByUserName(RegisterByUserNameQo registerByUserNameQo, String clientId);
    /**
     * 检验手机号是否已经注册p
     * */
    ZpzOauthResultMsg<Boolean> mobileExist(String phoneNumber, String clientId);
    /**
     * 用户忘记密
     * */
    ZpzOauthResultMsg<Boolean> forgetPwd(String clientId, ForgetPwdQo forgetPwdQo);

    Integer modifyPwd(String clientId, String ucode, String password, int defaultFlag);

    /**
     * 根据用户编号和访问客户端ID查询用户授权信息
     */
    ZpzOauthResultMsg<Authorize> getAuthorize(String userCode, String clientId);
    /**
     * 根据用户编号查询授权部门信息
     */
    ZpzOauthResultMsg<Authorize> getAuthorizeDepartment(String userCode);

    /**
     * 根据用户手机号获取用户信息
     */
    ZpzOauthResultMsg<UserAuthenticationVo> findUserByPhoneNumber(String phoneNumber, String clientId);

    /**
     * 根据用户手机号获取用户信息
     */
    ZpzOauthResultMsg<UserAuthenticationVo> findUserByUsernameAndUniquenum(String key, String clientId);

    /**
     * 根据用户手机号获取用户信息如果没有就创建一个用户
     */
    ZpzOauthResultMsg<UserAuthenticationVo> findUserByPhoneNumberCodeLogin(String phoneNumber, String clientId,
                                                                           String sourceClient);

    /**
     * 根据用户名查询用户信息
     */
    ZpzOauthResultMsg<UserAuthenticationVo> getUserInfoByUserName(String username, String clientId);

    /**
     * 校验用户是否锁定
     */
    ZpzOauthResultMsg<Boolean> validUserPasswordLocked(String ucode, String clientId);
    /**
     * 修改用户 登录时间
     */
    public ZpzOauthResultMsg<Boolean> modifyUserLoginDate(ModifyUserLoginDateQo modifyUserLoginDateQo);

    /**
     * 根据用户编号获取用户信息
     * */
    ZpzOauthResultMsg<GetUserInfoVo> getUserInfo(String clentId,String userCode);

    /**
     * 添加成员
     * */
    ZpzOauthResultMsg<String> addMember(HttpServletRequest request, InsertMemberQo insertMemberQo);
    /**
     * 删除成员
     * */
    ZpzOauthResultMsg<Boolean> deleteMember(String uCode,String clientId);

    /**
     * 查询成员详情
     * @param selectMemberDetailsQo
     * @return
     */
    ZpzOauthResultMsg<SelectMemberDetailsVo> selectMemberDetails(SelectMemberDetailsQo selectMemberDetailsQo, String clientId);

    /**
     * 分页查询成员详情
     * @param pageSelectMemberDetailsQo
     * @return
     */
    ZpzOauthResultMsg<PageInfo<SelectMemberDetailsVo>> pageSelectMemberDetails(PageSelectMemberDetailsQo pageSelectMemberDetailsQo) throws Exception;

    /**
     * 修改成员信息
     * @param updateMemberInfoQo
     * @return
     */
    ZpzOauthResultMsg<Boolean> updateMemberInfo(HttpServletRequest request, UpdateMemberInfoQo updateMemberInfoQo);

    ZpzOauthResultMsg editStatus(EditStatusQo editGasStationQo) throws Exception;


    ZpzOauthResultMsg editStatus(String userCode,Integer status) throws Exception;

    /**
     *
     * 功能描述: 修改密码验证
     *
     * @param modifyPasswordValidQo
     * @return
     * @author: zhangpanzhi
     * @date: 2019/5/31 15:39
     */
    ZpzOauthResultMsg<ModifyPasswordValidVo> modifyPasswordValid(ModifyPasswordValidQo modifyPasswordValidQo);

    /**
     *
     * 功能描述: 修改密码(验证码)
     *
     * @param modifyPasswordQo
     * @return
     * @author: zhangpanzhi
     * @date: 2019/5/31 15:39
     */
    ZpzOauthResultMsg<Boolean> modifyPassword(String clientId,ModifyPasswordQo modifyPasswordQo);
    /**
     * 修改密码（手机号+短信验证码+图形验证码）
     * @name: modifyPwdByMobileMsgAndImgCode
     * @author: zhangpanzhi
     * @createDate: 2021/2/20 9:06
     * @param response
     * @param request
     * @param modifyPwdByMobileMsgAndImgCodeQo
     * @return: ZpzOauthResultMsg<java.lang.Boolean>
     * @throws:
     */
    ZpzOauthResultMsg<Boolean>  modifyPwdByMobileMsgAndImgCode(HttpServletResponse response,HttpServletRequest request,ModifyPwdByMobileMsgAndImgCodeQo modifyPwdByMobileMsgAndImgCodeQo);
    /**
     *
     * 功能描述: 首次登录修改密码
     *
     * @param modifyPasswordByFirstLoginQo
     * @return
     * @author: zhangpanzhi
     * @date: 2020/4/7 15:39
     */
    ZpzOauthResultMsg<Boolean> modifyPasswordByFirstLogin(Map<String, String> license,ModifyPasswordByFirstLoginQo modifyPasswordByFirstLoginQo);

    /**
     *
     * 功能描述: 验证密码错误登录
     *
     * @param validUserPasswordQo
     * @return
     * @author: zhangpanzhi
     * @date: 2019/5/31 15:39
     */
    ZpzOauthResultMsg<ValidUserPasswordVo> validUserPassword(ValidUserPasswordQo validUserPasswordQo) throws Exception;

    /**
     *
     * 功能描述: 修改密码（验证旧密码）
     *
     * @param modifyPasswordByPwQo
     * @return
     * @author: zhangpanzhi
     * @date: 2019/5/31 15:39
     */
    ZpzOauthResultMsg<Boolean> modifyPasswordByOldPw(HttpServletRequest request, ModifyPasswordByPwQo modifyPasswordByPwQo);

    /**
     *
     * 功能描述: 修改手机号码
     *
     * @param modifyPhoneNumberQo
     * @return
     * @author: zhangpanzhi
     * @date: 2019/5/31 15:39
     */
    ZpzOauthResultMsg<Boolean> modifyPhoneNumber(HttpServletRequest request,ModifyPhoneNumberQo modifyPhoneNumberQo);

    /**
     * 验证是否首次登录
     * */
    ZpzOauthResultMsg<Boolean> checkIsFirstLogin(Map<String,String> license);
    /**
     * 验证手机号短信验证码图形验证码
     * @name: validMobileMsgAndImgCode
     * @author: zhangpanzhi
     * @createDate: 2021/2/20 9:53
     * @param response
     * @param request
     * @param validMobileMsgAndImgCodeQo
     * @return: ZpzOauthResultMsg<java.lang.String>
     * @throws:
     */
    ZpzOauthResultMsg<String> validMobileMsgAndImgCode(HttpServletResponse response, HttpServletRequest request, ValidMobileMsgAndImgCodeQo validMobileMsgAndImgCodeQo);
    /**
     * 验证图形验证码
     * @name: validImgCode
     * @author: zhangpanzhi
     * @createDate: 2021/2/1 12:31
     * @param request
     * @param validImgCodeQo
     * @return: ZpzOauthResultMsg<java.lang.Boolean>
     * @throws:
     */
    ZpzOauthResultMsg<Boolean> validImgCode(HttpServletResponse response,HttpServletRequest request,ValidImgCodeQo validImgCodeQo);
    /**
     * 修改密码（新密码旧密码确认密码手机号验证码）
     * @name: modifyPwdByMobile
     * @author: zhangpanzhi
     * @createDate: 2021/2/1 14:40
     * @param modifyPwdByMobileQo
     * @return: ZpzOauthResultMsg<java.lang.Boolean>
     * @throws:
     */
    ZpzOauthResultMsg<Boolean> modifyPwdByMobile(ModifyPwdByMobileQo modifyPwdByMobileQo);
    /**
     * 修改手机号（手机号验证码）
     * @name: modifyMobile
     * @author: zhangpanzhi
     * @createDate: 2021/2/1 14:53
     * @param modifyMobileQo
     * @return: ZpzOauthResultMsg<java.lang.Boolean>
     * @throws:
     */
    ZpzOauthResultMsg<Boolean> modifyMobile(ModifyMobileQo modifyMobileQo);
    /**
     * 发送短信验证码
     * @name: sendMsgCode
     * @author: zhangpanzhi
     * @createDate: 2021/2/3 14:49
     * @param sendMsgCodeQo
     * @return: ZpzOauthResultMsg<java.lang.Boolean>
     * @throws:
     */
    ZpzOauthResultMsg<Boolean> sendMsgCode(SendMsgCodeQo sendMsgCodeQo);

}
